package com.study.service;

import com.study.pojo.Video;
import com.study.service.fallback.OrderServiceFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

//将视频服务名称添加
@FeignClient(name="class-video-service", fallback = OrderServiceFallBack.class)
public interface OrderService {

    //写上路径，自动会携带参数
    @GetMapping("/api/v1/video/find_by_id")
    Video findById(@RequestParam("videoId") int videoId);

    //插入 - 传递对象到视频服务
    @PostMapping("/api/v1/video/insert")
    void insert(@RequestBody Video video);

}
